{ Statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=35
  Verdict: Accepted
}
uses
	SysUtils, Math;
 
var  	
	i, n, cur : longint;
	a, b, c : array[0..100010] of int64;
 
function count(n : int64) : int64;
begin
	result := (n * (n + 1)) shr 1;
end;
 
begin
	reset(input,'input.txt');
	rewrite(output,'output.txt');
	read(n);
	a[1] := 1;
	a[2] := 5;
	b[0] := 0;
	for i := 1 to n do
		b[i] := count(i);
	c[1] := 0;
	c[2] := 0;
	c[3] := 0;
	c[4] := 1;
	cur := 1;
	for i := 5 to n do begin
		if not odd(i) then inc(cur);
		c[i] := c[i - 1] + cur;
	end;
	for i := 3 to n do
		a[i] := a[i - 1] + b[i - 1] + c[i] + (2 * i - 1);
	write(a[n]);
end.